<template>
  <div class="mui-numbox" data-numbox-step='1' data-numbox-min="1" :data-numbox-max="max">
    <button class="mui-btn mui-btn-numbox-minus" type="button" disabled=''>-</button>
    <input id="test" class="mui-input-numbox" type="number" value="1" @change="getcount" ref='numbox'>
    <button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
  </div>


</template>

<script>
import mui from "../../lib/mui/js/mui.min.js";
export default {
  data() {
    return {
      count:1
    };
  },

  methods: {
    getcount(){
      this.$emit('getCount',parseInt(this.$refs.numbox.value))
    }
  },

  created() {

  },
  mounted() {
    // 初始化 数组选择框组件
    mui('.mui-numbox').numbox()
  },
  props:['max'],
  watch:{
    'max':function(newVal,oldVal) {
       mui('.mui-numbox').numbox().setOption('max',newVal)
    }
  }
};
</script>

<style lang='less' scoped>
</style>
